<?php

/**
 * LigneFactureAvoirClient filter form base class.
 *
 * @package    SdCommerce
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseLigneFactureAvoirClientFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'designation'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'taux_remise'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'quantite_livre'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'quantite'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'poids_net'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'poids_brut'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_unitaire_ht'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_total_ht'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_total_tttc'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_total_ttcnet'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_tva'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'article_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Article'), 'add_empty' => true)),
      'article_serieid'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ArticleSerie'), 'add_empty' => true)),
      'facture_avoirclientid' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FactureAvoirClient'), 'add_empty' => true)),
      'tva_id'                => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Tva'), 'add_empty' => true)),
      'maintenance_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Maintenance'), 'add_empty' => true)),
      'departement_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Departement'), 'add_empty' => true)),
      'unite_logistiqueid'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('UniteLogistique'), 'add_empty' => true)),
      'r'                     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'q'                     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'quantite_retourner'    => new sfWidgetFormFilterInput(),
      'created_at'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'designation'           => new sfValidatorPass(array('required' => false)),
      'taux_remise'           => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'quantite_livre'        => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'quantite'              => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'poids_net'             => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'poids_brut'            => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_unitaire_ht'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_total_ht'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_total_tttc'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_total_ttcnet'     => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_tva'              => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'article_id'            => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Article'), 'column' => 'id')),
      'article_serieid'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ArticleSerie'), 'column' => 'id')),
      'facture_avoirclientid' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('FactureAvoirClient'), 'column' => 'id')),
      'tva_id'                => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Tva'), 'column' => 'id')),
      'maintenance_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Maintenance'), 'column' => 'id')),
      'departement_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Departement'), 'column' => 'id')),
      'unite_logistiqueid'    => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('UniteLogistique'), 'column' => 'id')),
      'r'                     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'q'                     => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'quantite_retourner'    => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'created_at'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('ligne_facture_avoir_client_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LigneFactureAvoirClient';
  }

  public function getFields()
  {
    return array(
      'id'                    => 'Number',
      'designation'           => 'Text',
      'taux_remise'           => 'Number',
      'quantite_livre'        => 'Number',
      'quantite'              => 'Number',
      'poids_net'             => 'Number',
      'poids_brut'            => 'Number',
      'prix_unitaire_ht'      => 'Number',
      'prix_total_ht'         => 'Number',
      'prix_total_tttc'       => 'Number',
      'prix_total_ttcnet'     => 'Number',
      'prix_tva'              => 'Number',
      'article_id'            => 'ForeignKey',
      'article_serieid'       => 'ForeignKey',
      'facture_avoirclientid' => 'ForeignKey',
      'tva_id'                => 'ForeignKey',
      'maintenance_id'        => 'ForeignKey',
      'departement_id'        => 'ForeignKey',
      'unite_logistiqueid'    => 'ForeignKey',
      'r'                     => 'Number',
      'q'                     => 'Number',
      'quantite_retourner'    => 'Number',
      'created_at'            => 'Date',
      'updated_at'            => 'Date',
    );
  }
}
